<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="../../resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="../../resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
        <link href="../../stylesheet/default.css" rel="stylesheet" type="text/css" />
        <link type="text/css" rel="stylesheet" href="../../theme/start/theme.css"/>
        <ui:insert name="head-title">
            <title>Merlion ERP System</title>
        </ui:insert>
    </h:head>

    <h:body>

        <div id="top" style="margin-left: 12.5%; margin-right: 12.5%">
            <ui:insert name="top"><a href="index.xhtml"><img src="../images/topbanner.png" width="100%" height="100%"/></a>
                <h:form>
                    <p:menubar autoSubmenuDisplay="true" style="background-color: #123456" rendered="#{!controller.firstLogin}">
                        <p:submenu label="Profile" icon="ui-icon ui-icon-newwin">  
                            <p:menuitem value="View Profile" url="../profile/viewProfile.xhtml" /> 
                            <p:menuitem value="Edit Profile" url="../profile/editProfile.xhtml" /> 
                            <p:menuitem value="Change Password" url="../profile/changePassword.xhtml" />  
                            <p:menuitem value="View Global List" url="../profile/viewGlobalList.xhtml" /> 
                            <p:menuitem value="View Contact List" url="../profile/viewContactList.xhtml" />                             
                        </p:submenu>
                        <p:submenu label="Position" icon="ui-icon ui-icon-newwin" rendered="#{controller.admin}">  
                            <p:menuitem value="Home" url="../position/indexPosition.xhtml" /> 
                            <p:menuitem value="Add Position" url="../position/addPosition.xhtml" rendered="#{controller.adminCreatable}"/>  
                            <p:menuitem value="View Positions" url="../position/viewPosition.xhtml" rendered="#{controller.adminViewable}"/>                             
                        </p:submenu>
                        
                        <p:submenu label="Employee" icon="ui-icon ui-icon-newwin" rendered="#{controller.admin}">
                            <p:menuitem value="Home" url="../employee/indexEmployee.xhtml" /> 
                            <p:menuitem value ="Add Employee" url ="../employee/addEmployee.xhtml" rendered="#{controller.adminCreatable}"/>
                            <p:menuitem value ="View Employees" url ="../employee/viewEmployee.xhtml" rendered="#{controller.adminViewable}"/>
                        </p:submenu>
                        
                        <p:submenu label="Customer Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}">
                            <p:submenu label="Sale Lead" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                            <p:menuitem value="Home" url="../salelead/indexSaleLead.xhtml" /> 
                            <p:menuitem value="Add Sale Lead" url="../salelead/addSaleLead.xhtml"/>  
                            <p:menuitem value="View Sale Leads" url="../salelead/viewSaleLead.xhtml"/>  
                             </p:submenu>  
                         <p:submenu label="Customer" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                            <p:menuitem value="Home" url="../customer/indexCustomer.xhtml" /> 
                            <p:menuitem value="Add Customer" url="../customer/addCustomer.xhtml" rendered="#{controller.CRMCreatable}"/> 
                            <p:menuitem value="View Customers" url ="../customer/viewCustomer.xhtml" rendered="#{controller.CRMViewable}"/>
                         </p:submenu>
                        </p:submenu>
                        
                        <p:submenu label="Credit Control Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.FRMStaff}">
                                <p:submenu label="Credit Account" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">  
                                    <p:menuitem value="Home" url="../creditAccount/indexCreditAccount.xhtml" />                                    
                                    <p:menuitem value="Add Customer's Deposit" url="../creditAccount/addDeposit.xhtml" rendered="#{controller.FRMCreatable}"/>                                
                                    <p:menuitem value="View Customer's Credit Account" url="../creditAccount/viewCreditAccount.xhtml" rendered="#{controller.FRMViewable}"/>
                                </p:submenu>                                                                
                        </p:submenu>
                        
                        <p:submenu label="Billing and Payment Management" icon="ui-icon ui-icon-folder-open" rendered="#{controller.FRMStaff}">
                               <p:submenu label="Customer" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">  
                                    <p:submenu label="Invoice" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                        <p:menuitem value="Create Invoice for Customer" url="../deliveryOrder/successDeliveryOrder.xhtml" rendered="#{controller.FRMViewable}"/>
                                        <p:menuitem value="View All Invoices" url="../customerInvoice/viewAllCustomerInvoices.xhtml"/>
                                        <p:menuitem value="View Customer's Invoices" url="../customerInvoice/viewCustomerInvoices.xhtml"/>
                                    </p:submenu>
                                    
                                    <p:submenu label="Payment" icon="ui-icon ui-icon-newwin" rendered="#{controller.FRMStaff}">
                                        <p:menuitem value="Create Payment for Customer" url="../customerPayment/addCustomerPayment.xhtml" rendered="#{controller.FRMViewable}"/>
                                        <p:menuitem value="View All Payments" url="../customerPayment/viewAllCustomerPayments.xhtml"/>
                                        <p:menuitem value="View Customer's Invoices" url="../customerPayment/viewCustomerPayments.xhtml"/>
                                    </p:submenu>
                                </p:submenu>
                        </p:submenu>
                                              
                        <p:submenu label="Products" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}">
                            <p:submenu label="Prices" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Home" url="../product/indexProduct.xhtml" /> 
                                <p:menuitem value="Add New Price" url="../productPrice/addProductPrice.xhtml" rendered="#{controller.CRMCreatable}" />  
                                <p:menuitem value="View Prices" url="../productPrice/viewProductPrice.xhtml" rendered="#{controller.CRMViewable}"/>                             
                            </p:submenu> 
                            <p:submenu label="Discounts" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Home" url="../discount/indexDiscount.xhtml" /> 
                                <p:menuitem value="Add Discount" url="../discount/addDiscount.xhtml" rendered="#{controller.CRMCreatable}"/> 
                                <p:menuitem value="View Discounts" url="../discount/viewDiscount.xhtml" rendered="#{controller.CRMViewable}"/>
                            </p:submenu>
                        </p:submenu>

                        <p:submenu label="Sales Order Processing" icon="ui-icon ui-icon-folder-open" rendered="#{controller.CRMStaff}" >
                            <p:submenu label="Sale Inquiry" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">
                                <p:menuitem value="Home" url="../saleinquiry/indexSaleInquiry.xhtml"/>
                                <p:menuitem value="Add Sale Inquiry" url="../saleinquiry/addSaleInquiry.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="View Sale Inquiries" url="../saleinquiry/viewSaleInquiry.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                            <p:submenu label="Sale Quotation" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">
                                <p:menuitem value="Home" url="../salequotation/indexSaleQuotation.xhtml"/>
                                <p:menuitem value="Add Sale Quotation" url="../salequotation/addSaleQuotation.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="View Sale Quotations" url="../salequotation/viewSaleQuotation.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                            <p:submenu label="Sale Order" icon="ui-icon ui-icon-newwin" rendered="#{controller.CRMStaff}">  
                                <p:menuitem value="Home" url="../saleorder/indexSaleOrder.xhtml"/>
                                <p:menuitem value="Add Direct Sale Order" url="../saleorder/addDirectSaleOrder.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="View Sale Orders" url="../saleorder/viewSaleOrder.xhtml" rendered="#{controller.CRMViewable}"/> 
                            </p:submenu>
                        </p:submenu>
                        
                                                <p:submenu label="Balance Record" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Product Balance" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                <p:menuitem value="View Product Balance" url="../balance/viewProductBalance.xhtml" rendered="#{controller.SCMViewable}"/>
                            </p:submenu>
                            <p:submenu label="Material Balance" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                <p:menuitem value="View Material Balance" url="../balance/viewMaterialBalance.xhtml" rendered="#{controller.SCMViewable}"/>
                            </p:submenu>
                        </p:submenu>
                        
                        <p:submenu label="Inbound Inventory Control" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Product Batch" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                <p:menuitem value="Home" url="../productBatch/indexProductBatch.xhtml"/>
                                <p:menuitem value="Add New Batch" url="../productBatch/addProductBatch.xhtml" rendered="#{controller.SCMCreatable}"/>
                                <p:menuitem value="View Product Batch" url="../productBatch/viewProductBatch.xhtml" rendered="#{controller.SCMViewable}"/>
                            </p:submenu>
                        </p:submenu>
                        

                        
                        
                        <p:submenu label="Outbound Inventory Control" icon="ui-icon ui-icon-folder-open" >
                            <p:submenu label="Delivery Order" icon="ui-icon ui-icon-newwin" >
                                <p:menuitem value="Home" url="../deliveryOrder/indexDeliveryOrder.xhtml"/>
                                <p:menuitem value="View Delivery Orders" url="../deliveryOrder/viewDeliveryOrder.xhtml" rendered="#{controller.CRMCreatable}"/>
                                <p:menuitem value="Send Invoice" url="../deliveryOrder/successDeliveryOrder.xhtml" rendered="#{controller.FRMStaff}"/> 
                            </p:submenu>
                        </p:submenu>
                        
                                                <p:submenu label="Inbound Material Control" icon="ui-icon ui-icon-folder-open" rendered="#{controller.SCMStaff}">
                            <p:submenu label="Material Batch" icon="ui-icon ui-icon-newwin" rendered="#{controller.SCMStaff}">
                                <p:menuitem value="Home" url="../materialBatch/indexMaterialBatch.xhtml"/>
                                <p:menuitem value="Add New Batch" url="../materialBatch/addMaterialBatch.xhtml" rendered="#{controller.SCMCreatable}"/>
                                <p:menuitem value="View Material Batch" url="../materialBatch/viewMaterialBatch.xhtml" rendered="#{controller.SCMViewable}"/>
                            </p:submenu>
                        </p:submenu>

                        
    
                        <p:menuitem value="Log Out" actionListener="#{controller.logOut()}" icon="ui-icon ui-icon-close" />                      
                        
                    <p:menubar autoSubmenuDisplay="true" style="background-color: #123456" rendered="#{!controller.firstLogin}">
                        <p:submenu label="Profile" icon="ui-icon ui-icon-newwin">  
                            <p:menuitem value="View Profile" url="../profile/viewProfile.xhtml" /> 
                            <p:menuitem value="Edit Profile" url="../profile/editProfile.xhtml" /> 
                            <p:menuitem value="Reset Password" url="resetPassword.xhtml" />
                        </p:submenu>
                        <p:menuitem value="Log Out" actionListener="#{controller.logOut()}" icon="ui-icon ui-icon-close" /> 
                    </p:menubar>
                    </p:menubar>
                    </h:form>
            </ui:insert>
        </div>
        <div style="margin-left: 12.5%; margin-right: 12.5%">
        <table style="border-style: none; border-spacing: 0px;width: 100%">
            <tr>
                <td id="leftcontent" class="left_content" style="width: 30%; background-color: white;" valign="top">
                    <p:panel>

                        <b>Announcements</b> <a href="index.xhtml">(View All)</a>

                    </p:panel>
                    <p:panel>

                        <b>Messages</b> <a href="../messageMe.xhtml">(View All)</a>

                    </p:panel>
                    <p:panel header="Shortcuts"> 
                        <a href="index.xhtml">Add New Employee</a>
                        <br/><a href="index.xhtml">Add New Position</a>
                        <br/><a href="index.xhtml">View Profile</a>
                        <br/><a href="index.xhtml">Edit Profile</a>
                        <br/>
                    </p:panel> 
                    <p:panel header="To-do List"> 
                        <a href="index.xhtml">Call Jolie</a><br/>
                        <a href="index.xhtml">Week report @ Fri</a><br/>
                    </p:panel> 
                </td>
                <td id="content" class="right_content" style="width: 70%;" valign="top">
                    <ui:insert name="content">
                        Please insert content here!
                    </ui:insert>
                </td>
            </tr>
        </table>
        </div>
        <div id="bottom" class="right_content" style="margin-left: 12.5%; margin-right: 12.5%;margin-top: 0px;">
            <ui:insert name="bottom">
                <p class="copyright">Copyright © 2011 Merlion Food Limited. All rights reserved.</p>   
            </ui:insert>
        </div>
    </h:body>

</html>
